<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:icecore="http://www.icefaces.org/icefaces/core"
      xmlns:ace="http://www.icefaces.org/icefaces/components"
      xmlns:ice="http://www.icesoft.com/icefaces/component">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>SYSGECON</title>
        <!--librerias a utilizar para los paneles y sus colores-->
        <link href="/ContaSoft/css/default.css" rel="stylesheet" type="text/css" />
        <link href="/ContaSoft/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="/ContaSoft/css/royale/royale.css" rel="stylesheet" type="text/css" />
        <script src="/ContaSoft/js/jquery.js" type="text/javascript"></script>
        <script type="text/javascript">
            function searchByEnterAndReturn(e){ 
                if(e.keyCode==13){
                    //document.getElementById("login:ingresar").click(); 
                    //alert('hola')
                    event.keyCode=9;
                }  
             }
        </script>
        <script languaje="Javascript">
              function salir(){
                
                  window.close();
          }
           
        </script>
        <script>
            function keyLock(e){
                tecla = (document.all)?e.keyCode:e.which;
                if (tecla==8) return true;
                patron = /\w/;
                te = String.fromCharCode(tecla);
                return patron.test(te);
             }
        </script>
    </h:head>
    <h:body   >
        <!--onUnload=alert("Goodbye")-->

        <!--Panel superior-->

        <div>
            <h:form id="login">
                <ice:panelGrid columns="2" styleClass="centrarlogin">
                    <h:outputLabel value="Usuario:"/>
                    <h:inputText value="#{loginController.usuario.segLoginUsu}" />
                    <h:outputLabel value="Password:"/>
                    <h:inputSecret value="#{loginController.usuario.segPasswordUsu}" required="true" 
                                   onkeypress="if(verifyKeyEnter(event)) return false;">
                        <f:ajax event="keyup" 
                                listener="#{loginController.validarusuario()}"
                                execute="@this"/>
                        <f:validateLength minimum="4" maximum="10"/>
                    </h:inputSecret>
                    <h:commandButton id="ingresar" value="Ingresar" action="#{loginController.validarusuario()}"/>
                    <h:commandButton value="Salir"   onclick="salir()"/>
                </ice:panelGrid>
            </h:form>
        </div>
        <!--Panel popup para los mensajes de error que se presente en  los errores-->
        <ice:form>
            <ice:panelPopup id="modalPnlPop" draggable="false" modal="true" visible="#{loginController.panelpopupvisible}" autoCentre="true" 
                            style="z-index: 1000; top: 20%; left: 10%; position: absolute; width: 300px; height: 150px;">
                <f:facet name="header">
                    <ice:panelGroup styleClass="popupHeaderWrapper">
                        <ice:outputText value="Informe"/>
                        <ice:commandButton id="modalPnlCloseBtn"
                                           value="x"
                                           actionListener="#{loginController.llamarPanelpopupvisible(event)}"
                                           title="Cerrar" alt="Cerrar"/>
                    </ice:panelGroup>
                </f:facet>
                <f:facet name="body">
                    <ice:panelGroup>
                        <ice:messages globalOnly="false" showSummary="true" showDetail="true"/><br/>

                    </ice:panelGroup>
                </f:facet>
            </ice:panelPopup>
        </ice:form>
    </h:body>

</html>
